<?xml version="1.0" encoding="UTF-8"?>
<f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:w="http://www.apusic.com/jsf/widget" xmlns:layout="http://www.apusic.com/jsf/layout"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:ajax="http://www.apusic.com/jsf/ajax"
	renderKitId="AJAX">
	<w:head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<w:stylesheet src="/css/kmp4.css" type="text/css"></w:stylesheet>
		<w:script src="/javascript/k4.js" type="text/javascript" language="UTF-8"></w:script>
		<script>
		//<![CDATA[
		 	function show(v, m, r, rIndex){
             var id=r.get('id');
             var url="#{facesContext.externalContext.requestContextPath}/modules/sso/showHuman.faces?id="+id;
             return "<a href=\"javascript:addCenterLayoutTab('showHumanTab','查看系统','"+url+"')\">"+v+"</a>";
    	   }
    	   function freshme(){
 		    var store=listHumanGridJsvar.getStore();
		    store.reload(store.lastOptions);
     	   }
    	   function checkDelete(){
		 	var r = listHumanGridJsvar.getSelectionModel().getSelected();
    		if(r == null){
    			alert('请选择一条记录!');
    			return false;
    		}
    		return showConfirm('确认删除吗?');
		   }
		   //]]>
		 </script>
	</w:head>
	<w:page title="系统用户">
		<layout:panel border="false" header="false" styleClass="k4-view" autoHeight="true"
			autoWidth="true">
			<layout:panel id="viewtoolbar" border="false" autoHeight="true" autoWidth="true">
				<w:form>
					<w:toolBar>
						<w:button label="新增" image="/images/create.gif" id="addSystem" immediate="true"
							onclick="javascript:addCenterLayoutTab('addHumanTab','新增','#{facesContext.externalContext.requestContextPath}/modules/sso/addHuman.faces');" />
						<w:separator />
						<w:button label="编辑" image="/images/edit.gif" id="eidtHuman" immediate="true" />
						<w:separator />
						<w:button label="删除" image="/images/delete.gif" onclick="return checkDelete();"
							id="deleteHuman" immediate="true" />
					</w:toolBar>
				</w:form>
			</layout:panel>
			<layout:panel title="搜索条件" border="false" autoHeight="true" autoWidth="true" collapsible="true"
				collapsed="false" styleClass="k4-view-search">
				<w:form>
					<layout:panelGrid columns="4" styleClass="k4-view-search" cellpadding="0" cellspacing="0"
						border="1">
						<layout:cell styleClass="k4-form-fieldtitle">
							<h:outputLabel value="系统名称" for="keywords" />
						</layout:cell>
						<layout:cell styleClass="k4-form-fieldvalue">
							<w:textField width="216" id="systemNameForSearch" jsvar="systemNameJsvar"></w:textField>
						</layout:cell>
						<layout:cell styleClass="k4-form-fieldtitle">
							<h:outputLabel value="系统用户" for="keywords" />
						</layout:cell>
						<layout:cell styleClass="k4-form-fieldvalue">
							<w:textField width="216" id="humanNameForSearch" jsvar="humanNameJsvar"></w:textField>
						</layout:cell>
						<layout:cell colspan="2" styleClass="k4-form-fieldvalue">
							<layout:panelGrid columns="2" cellpadding="0" cellspacing="0">
								<w:button id="query" value="查询"
									image="#{facesContext.externalContext.requestContextPath}/images/search.gif" />
								<w:button id="reset" value="重置" 
									image="#{facesContext.externalContext.requestContextPath}/images/clear.gif"	/>
							</layout:panelGrid>
						</layout:cell>
					</layout:panelGrid>
				</w:form>
			</layout:panel>
			<w:dataGrid id="listHumanGrid" rows="15" paged="true" border="false" showRowNumber="true"
				styleClass="k4-view-datagrid" autoHeight="true" singleSelect="true" jsvar="listHumanGridJsvar" var="human"
				toolBarPosition="bottom">
				<w:outputColumn  value="#{human.id}" header="id" hidden="true"></w:outputColumn>
				<w:outputColumn  value="#{human.humanName}" header="系统用户" width="100" clientFormatter="show" sortable="true"></w:outputColumn>
				<w:outputColumn  value="#{human.system.systemName}" header="所属系统" width="150"></w:outputColumn>
				<w:pagingToolbar for="listHumanGrid" displayInfo="true" displayMsg="显示 {0} - {1}，共 {2} 条" />
			</w:dataGrid>
			</layout:panel>
	</w:page>
</f:view>